#include <stdio.h>
#include <stdbool.h>

bool checkPerfectNumber(int num)
{
    int count = 0;
    int flag = 0;
    for(int i = 1;i <= num;i++)
    {
        for(int j = 1;j <= num;j++)
        {
            if(i * j == num && i == j)
                flag = i;
            if(i * j == num)
            {
               count += (i + j);
               break;
            }
                
        }
    }
    if(flag == 0)
        count = count/2 - num;
    else
        count = count/2 +flag - num;
    if(count == num)
        return true;
    else
        return false;
}

int main()
{
    int num = 28;
    if(checkPerfectNumber( num))
        printf("true\n");
    else
        printf("false\n");
    return 0;
}